home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / -seriously_amiga- / shareware / programming / other / medlibpashs / examples / medtest.pascal
Text File  |  1997-12-01  |  789b  |  33 lines

  1. program MedTest;
  2. uses MedPlayer, Exec;
  3.  
  4. const
  5.     MED_Filename = 'dh1:x3.med';    { *** CHANGE THIS *** }
  6.  
  7. var
  8.     LugarMed    : pointer;    { pointer for MED module in memory    }
  9.     RetCode     : longint;  { function return code                }
  10.     bibibi        : string;    { 'press enter for stopping'        }
  11.  
  12. begin
  13.     { open library    }
  14.     MedPlayerBase := OpenLibrary ('medplayer.library',2);
  15.  
  16.     { allocate channels and whatever..    }
  17.     RetCode := GetPlayer (0);
  18.  
  19.     { load and, then, play..    }
  20.     LugarMed := LoadModule (MED_Filename);
  21.     PlayModule (LugarMed);
  22.  
  23.     { wait for [enter], then, stop playing    }
  24.     writeln ('press [enter] for stop playing');
  25.     read (bibibi);
  26.     StopPlayer;
  27.     writeln ('music stopped.');
  28.  
  29.     { unload module from mem, de-allocate channels, close library    }
  30.     UnLoadModule (LugarMed);
  31.     FreePlayer;
  32.     CloseLibrary (MedPlayerBase);
  33. end.